<template>
	<view class="content">
		<u-notice-bar text="点击蓝色链接可以复制哦~" mode="closable"></u-notice-bar>
		<h1>{{articalDate.title}}</h1>
		<view class="auth">{{articalDate.date}}-{{articalDate.name}}</view>
		<view class="url_" @click="copy(text_)">
			{{text_}}
		</view>
		<rich-text :nodes="articalDate.html"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				text_: '',
				articalDate: {}
			};
		},
		methods: {
			copy(value) {
				uni.setClipboardData({
					data: value,
					success: function() {
						console.log('success');
					}
				})
			}
		},

		onLoad: function(option) {
			uni.showLoading()
			console.log('option', option);
			this.articalDate = JSON.parse(decodeURIComponent(option.item))
			this.text_ = this.articalDate.url
			uni.hideLoading()
			console.log(this.articalDate)
		}
	}
</script>

<style lang="scss">
	.content {
		width: 100vw;
		box-sizing: border-box;
		padding: 30rpx 20rpx 40rpx;

		h1 {
			font-size: 35rpx;
			font-weight: bold;
		}

		.auth {
			font-size: 24rpx;
			color: #7d7d7d;
			margin: 10rpx 0 20rpx;
		}

		.url_ {
			width: 100%;
			margin: 20rpx 0rpx;
			color: #0066CC;
			font-size: 30rpx;
			word-wrap: break-word;
			word-break: normal;
		}
	}
</style>
